package router

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/ghttp"
	"github.com/gogf/gf/v2/os/gfile"
	"go-websocket/internal/service"
)


var Websocket *ghttp.Server

func init()  {
	//websocket服务
	websocket := g.Server("websocket")
	websocket.BindHandler("/", service.Conn)//开启websocket
	websocket.SetPort(8383)
	websocket.SetIndexFolder(true)
	websocket.SetServerRoot(gfile.MainPkgPath())

	Websocket = websocket
	//websocket.Start()
}
